using log4net;
using NUnit.Framework;
using Rhino.Mocks;

namespace LoggingMagic.Tests.Integration.StaticFieldTests
{
    [TestFixture]
    public class ClassWithCtorTests
    {
        private ILog _logger;

        private Initializer _initializer;
        [TestFixtureSetUp]
        public void FixtureSetUp()
        {
            _initializer = new Initializer();
        }
        [TestFixtureTearDown]
        public void Dispose()
        {
            _initializer.Dispose();
        }

        [SetUp]
        public void Setup()
        {
            _logger = MockRepository.GenerateStrictMock<ILog>();
            Initializer.SetLogger(_logger);
        }

        [Test]
        public void CtorLogged()
        {
            _logger.Expect(x => x.Info("ClassWithCtor..ctor - Entering"));

            Initializer.GetClassWithCtorInstance();

            _logger.VerifyAllExpectations();
        }
    }
}